#include <stdlib.h>
#include <stdio.h>
#include <string.h>

#include "regexreplace.h"

int main(int vv, char** cc){

	char* result;

	if(regexreplace("shaped_\\([0-9]*\\)_\\([0-9]*\\)", "quota_policer(\\1,\\2)", "shaped_500_400  and shaped_900_100", &result, 256)==0){
		printf("====>%s<===\n",result); 
		free(result);
	}

	if(regexreplace("\\([0-9][0-9]*\\)_\\([abc]\\)", "quota_policer(\\1,\\2)", "hello_100_c mr barbie 987_a naf", &result, 256)==0){
		printf("====>%s<===\n",result); 
		free(result);
	}

	if(regexreplace("\\([0-9][0-9]*\\)_\\([abc]\\)", "quota_policer(\\1,\\2-\\3)", "hello_100_c mr barbie 987_a naf", &result, 256)==0){
		printf("====>%s<===\n",result); 
		free(result);
	}

	if(regexreplace("\\([0-9][0-9]*\\)_\\([abc]\\)", "", "hello_100_c mr barbie 987_a naf", &result, 256)==0){
		printf("====>%s<===\n",result); 
		free(result);
	}

	
	if(regexreplace("shaped_\\([0-9]*\\)_\\([0-9]*\\)", "quota_policer(\\1,\\2)", "shaped_500_400  and shaped_900_100", &result, 24)==0){
		printf("====>%s<===\n",result); 
		free(result);
	}


}



